import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Index',
    redirect: { name: 'Login' }
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import('../views/login/Login')
  },
  {
    path: '/',
    name: 'Main',
    component: () => import('../views/Main'),
    children: [
      {
        path: '/home',
        name: 'home',
        component: () => import('../views/Home/Home')
      },
      {
        path: '/usermanage',
        name: 'usermanage',
        component: () => import('../views/Manage/Usermanage')
      },
      {
        path: '/postmanage',
        name: 'postmanage',
        component: () => import('../views/Manage/Postmanage')
      },
      {
        path: '/checkmanage',
        name: 'checkmanage',
        component: () => import('../views/Manage/Checkmanage')
      }
    ]
  }
  // {
  //   path: '/home',
  //   name: 'Home',
  //   component: () => import('../views/Home/Home'),
  //   children: [
  //     {
  //       path: '/usermanage',
  //       name: 'usermanage',
  //       component: () => import('../views/Manage/Usermanage')
  //     }
  //   ]
  // },
  // {
  //   path: '/home',
  //   name: 'Home',
  //   component: () => import('../views/Home/Home')
  // },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
